home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 1
/
Cream of the Crop 1.iso
/
PRINTER
/
PROHP.ARJ
/
DSCALEF.PRG
< prev
next >
Wrap
Text File
|
1992-06-23
|
3KB
|
74 lines
/*
┌─────────────────────────────────────────────────────────────────────────┐
│ │
│ Program : scalef.prg │
│ Purpose : Usage of scalable fonts. ├
│ │
│ Author : Copyright (C) 1992, I.L.A.,Inc. All Rights reserved. │
│ │
│ Comments: This source code may be distributed and used freely │
│ provided that the copyright notice is not removed. │
│ │
└─────────────────────────────────────────────────────────────────────────┘
*/
#include "prohp.ch"
static zpoint:=10, zstyle:=UPRIGHT, zsw:=0, zsym:=SYM_PC_8
static ztypeface:=4101
STATIC aWUniverse[256]
proc main()
Local o,st1,st2,T,apt
Local AST,cline, bFont[8],f,i,aWidth,nLeft:=18,aFont
bFont[1]:={|p| HP_scalef(p,UPRIGHT,0,SYM_PC_8,TF_UNIVERSE)}
bFont[2]:={|p| HP_scalef(p,ITALIC,0,SYM_PC_8,TF_UNIVERSE)}
bFont[3]:={|p| HP_scalef(p,UPRIGHT,3,SYM_PC_8,TF_UNIVERSE)}
bFont[4]:={|p| HP_scalef(p,ITALIC,3,SYM_PC_8,TF_UNIVERSE)}
bFont[5]:={|p| HP_scalef(p,UPRIGHT,0,SYM_PC_8,TF_CGTIMES)}
bFont[6]:={|p| HP_scalef(p,ITALIC,0,SYM_PC_8,TF_CGTIMES)}
bFont[7]:={|p| HP_scalef(p,UPRIGHT,3,SYM_PC_8,TF_CGTIMES)}
bFont[8]:={|p| HP_scalef(p,ITALIC,3,SYM_PC_8,TF_CGTIMES)}
set2print("dscalef.hpc")
hp_init()
HP_send(.f.)
cline:=HP_setpos(-0.1,,.t.)+HP_rline(0.15,0.005)+HP_setpos(0.1,,.t.)
HP_send(.t.)
ST1:="ProHP"
st2:="Laser Printer library for Clipper"
// draw gray area covering the full page
// this trick will show you the printing area on the page
HP_hline(0,0,12,10,GFILLGRAY,10)
HP_box(0,0,10,HP_data(D_RMI)-HP_data(D_LMI)-HP_data(D_LINEWIDTH))
HP_lpi(3.6) // set lpi but it will not work later because
// hpscalef() sets LPI according to the point selected
// prepare center column
nLeft := (HP_data(D_RMI)-HP_data(D_LMI)) /2
aPt:={5,10,15,20,24,28}
HP_setpos(0,0)
for i:=1 to len(aPt)
eval(bFont[i],aPt[i]*4) // make font
HP_rcpos(1,,.t.) // down one line
HP_center(,nLeft,st1) // center text on page
eval(bFont[i],aPt[i]) // same font different size
HP_rcpos(1,,.t.) // down one line
HP_center(,nLeft,st2) // center next text line
next
eval(bFont[4],aPt[4]) // make scalable font
HP_rcpos(2,,.t.) // two lines down
// start at the current row , find the current margin - 1 space
// and print the array right justify
HP_aatsay(,HP_data(D_RMI)-HP_data(D_LMI)-1/HP_data(D_CPI),;
{st1,st2},,"R")
//HP_reset() // reset will erase the scalable fonts created above.
HP_feed() // just print and feed the page out.
set2screen()
return